home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / dsp / dr.bub / 96000.lha / 96000 / appb / b119.asm < prev    next >
Assembly Source File  |  1992-04-28  |  4KB  |  89 lines

  1. ; This program was originally published in the Motorola DSP96002 Users Manual
  2. ; and is provided under a DISCLAIMER OF WARRANTY available from Motorola DSP
  3. ; Operation, 6501 William Cannon Drive West, Austin, Texas 78735-8598.  For
  4. ; more information, refer to the DSP96002 Users Manual, Appendix B, DSP
  5. ; Benchmarks.
  6. ;
  7. ; B.1.19    General Lattice Filter  
  8. ;                                                  GENERAL LATTICE 
  9. ;              COEFFICIENT AND STATE VARIABLE STORAGE 
  10. ;       r0                         r4 
  11. ;                                    
  12. ;     
  13. ;    x: k3 k2 k1 w3 w2 w1 w0    y: s4 s3 s2 s1 
  14. ;       m0=6 (=2*N, mod 7)     m4=3 (=N, mod 4) 
  15. ;                                                SINGLE SECTION 
  16. ;                                             EQUATIONS: 
  17. ;         
  18. ;                                          t'=t-k*s 
  19. ;                                          s'=s+k*t' 
  20. ;                                           t'?t 
  21.                       
  22. ;                                          output= sum(s'*w) 
  23. ;                  
  24. ;                        
  25. ;            
  26.           
  27.               
  28.                
  29.              
  30.  
  31. ;                                           DSP56000 IMPLEMENTATION 
  32. ;                                                                              Program    ICycles
  33. ;                                                            Words 
  34. ; move   #k,r0              ;point to coefficients 
  35. ; move   #2*N,m0            ;mod 2*(# of k's)+1 
  36. ; move   #state,r4          ;point to filter states 
  37. ; move   #N,m4              ;mod on filter states 
  38. ; movep  y:datin,a          ;get input sample 
  39. ; move          x:(r0)+,x0 y:(r4)-,y0 ;get first k, first s     1    1 
  40. ; do   #N,_el                         ;do filter                2    3 
  41. ; macr -x0,y0,a            b,y:(r4)+  ;t-k*s, save prev s       1    1 
  42. ; move          a,x1       y:(r4)+,b  ;copy t',get s again      1    1 
  43. ; macr  x1,x0,b x:(r0)+,x0 y:(r4)-,y0 ;t'*k+s,get k,get s       1    1 
  44. ;_el 
  45. ; move                     b,y:(r4)+  ;sv scnd to 1st st        1    1 
  46. ; clr   a                  a,y:(r4)+  ;save first state         1    1 
  47. ; move                     y:(r4)+,y0 ;get last state           1    1 
  48. ; rep   #N                                                      1    2 
  49. ; mac   x0,y0,a x:(r0)+,x0 y:(r4)+,y0 ;do fir taps              1    1 
  50. ; macr  x0,y0,a              (r4)+    ;finish, adj pointer      1    1 
  51. ; movep a,y:datout                    ;output sample 
  52. ;                                                             ---   --- 
  53. ;                                                                             Totals: 12  4N+10 
  54. ;                                        DSP96002 IMPLEMENTATION 
  55. ;                                                            Program    ICycles
  56. ;                                                            Words 
  57.  move   #k,r0              ;point to coefficients 
  58.  move   #2*N,m0            ;mod 2*(# of k's)+1 
  59.  move   #state,r4          ;point to filter states 
  60.  move   #N,m4              ;mod on filter states 
  61.  
  62.  move p  y:datin,d1         ;get input sample 
  63.  
  64.  move        #2,n4                                        ;  1       1 
  65.  move                        x:(r0)+,d5.s y:(r4)-,d6.s    ;  1       1 
  66.  do   #N,_elat                                            ;  2       3 
  67.  fmpy d5,d6,d0  fadd.s d0,d3                              ;  1       1 
  68.                 fadd.s d0,d1 d6.s,d3.s    d3.s,y:(r4)+n4  ;  1       1 
  69.  fmpy.s d5,d1,d0             x:(r0)+,d5.s y:(r4)-,d6.s    ;  1       1 
  70. _elat 
  71.                 fadd.s d0,d3                              ;  1       1 
  72.  fclr   d0                                d3.s,y:(r4)+    ;  1       1 
  73.  fclr   d1                                d1.s,y:(r4)+    ;  1       1 
  74.  move                                     y:(r4)+,d4.s    ;  1       1 
  75.  rep   #N                                                 ;  1       2 
  76.  fmpy d5,d4,d0  fadd.s d0,d1 x:(r0)+,d5.s y:(r4)+,d6.s    ;  1       1 
  77.                 fadd.s d2,d3              (r4)+           ;  1       1 
  78.  move p  d3.s,y:datout         ;output sample 
  79. ;                                                           ---     --- 
  80. ;                                                   Totals:  14    4N+12 
  81.  
  82.